package com.gome.ocean.common.enums.job;

/**
 * 读取插件
 * 
 * @author haqiaolong 2016年1月21日 下午4:55:57
 * @since 5.0.0
 */
public enum Writer {
                    DRDS(0), MONGODB(1), MYSQL(2), ORACLE(3), STREAM(4), HDFS(5), REDIS(6);

    private int value;

    private Writer(int value){
        this.value = value;
    }

    public static Writer getName(int value) {
        for (Writer writer : Writer.values()) {
            if (writer.getValue() == value) {
                return writer;
            }
        }
        return null;
    }

    public int getValue() {
        return value;
    }

    public static String getString(Writer writer) {
        switch (writer) {
            case DRDS:
                return "Drds";
            case MONGODB:
                return "MongoDB";
            case MYSQL:
                return "Mysql";
            case ORACLE:
                return "Oracle";
            case HDFS:
                return "Hdfs";
            case STREAM:
                return "Stream";
            case REDIS:
                return "Redis";
        }
        return null;
    }
}
